package com.joint.base.entity;

import com.joint.base.bean.FlowEnum;
import com.joint.base.parent.BaseEntity;

import javax.persistence.*;
import java.util.Set;

/**
 * Created by ZhuChunXiao on 2017/2/14.
 * 待办事宜
 */
@Entity
@Table(name="sys_tododata")
public class TodoData extends BaseEntity {


    private static final long serialVersionUID = -6684045895926332215L;
    //文档id
    private String keyId;

    //所属的实体类名
    private String entityName;

    //关联用户
    private Users users;

    //上一步操作人
    private Set<Users> prevUsers;


    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "sys_tododata_prevusers", joinColumns = @JoinColumn(name="id"),inverseJoinColumns =  @JoinColumn(name="prevUsersId"))
    public Set<Users> getPrevUsers() {
        return prevUsers;
    }

    public void setPrevUsers(Set<Users> prevUsers) {
        this.prevUsers = prevUsers;
    }

    public String getKeyId() {
        return keyId;
    }

    public void setKeyId(String keyId) {
        this.keyId = keyId;
    }

    public String getEntityName() {
        return entityName;
    }

    public void setEntityName(String entityName) {
        this.entityName = entityName;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    public Users getUsers() {
        return users;
    }

    public void setUsers(Users users) {
        this.users = users;
    }
}
